import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

'''
散点矩阵图
'''
data = pd.DataFrame(np.random.randn(1000,4)*100,   # 生成100行，4列的随机数矩阵，每个矩阵里的数乘以100
                    columns = ['A','B','C','D'])  # 作成A,B,C,D四列
print('data:\n', data)
grr = pd.plotting.scatter_matrix(data,
                figsize=(8,8),
                  c = 'k',
                 marker = '+',
                 diagonal='hist',
                 alpha = 0.8,
                 range_padding=0.1) # 速度更快
# sns.pairplot(data) # 速度更慢
plt.show()